<script setup lang="ts">
import type { MenuOption } from 'naive-ui'
// import {useMessage} from 'naive-ui'
import menuOptions from "./ts/menu-options"
import {useRoute} from "vue-router";
import {ref} from "vue";

// const message = useMessage()
const route = useRoute()

const menuDefaultVal = ref(menuOptions[0].key)

function handleUpdateValue(key: string, item: MenuOption) {
  // message.info(`[onUpdate:value]: ${JSON.stringify(key)}`)
  // message.info(`[onUpdate:value]: ${JSON.stringify(item)}`)
  console.log(route)
}
</script>

<template>
  <div class="menu">
    <n-menu
      :options="menuOptions"
      :default-value="menuDefaultVal"
      accordion
      @update:value="handleUpdateValue"
    />
  </div>
</template>

<style scoped>

</style>
